package sybl.lx.com.vpitest.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

/**
 * Created by Administrator on 2015/10/13.
 */
public class VpAadapter  extends FragmentPagerAdapter{
    private ArrayList<Fragment> fragments;
    public VpAadapter(FragmentManager fm,ArrayList<Fragment> fragments) {
        super(fm);
        this.fragments =fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments==null?0:fragments.size();
    }

}
